package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.PublisherCountry;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class GxPublisherCountry extends PublisherCountry {
    public GxPublisherCountry(Element element) {
        if (element.getElementsByTagName("Country").getLength() > 0 &&
            element.getElementsByTagName("Country").item(0).getChildNodes().getLength() > 0) {
            this.setCountry(((Node) element.getElementsByTagName("Country").item(0).getChildNodes().item(0)).getNodeValue());
        }
        if (element.getElementsByTagName("IsOptedIn").getLength() > 0 &&
            element.getElementsByTagName("IsOptedIn").item(0).getChildNodes().getLength() > 0) {
            this.setIsOptedIn(Boolean.valueOf(((Node) element.getElementsByTagName("IsOptedIn").item(0).getChildNodes().item(0)).getNodeValue()));
        }
    }
}
